<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="itsm.isperp.framework.core.context.ContextHolder"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<%
  String path = request.getContextPath();
			String basePath = ContextHolder.getWebServerName(request);
%>

<!-- <div data-role="header" data-position="inline"
	class="ui-header ui-bar-a" role="banner">
	<h1 class="ui-title" role="heading" aria-level="1">知识库查询</h1>
</div> -->



<div data-role="content" class="ui-content" role="main"
	style="background-color:f8f8f8;bottom:0;top:0;left:0;right:0">

	<%-- <input type="search"
			class="ui-input-search ui-body-inherit ui-corner-all ui-shadow-inset ui-input-has-clear"
			name="keyword" value="${keyword }" placeholder="输入查询关键字"> --%>
	<div class="page searchbar js_show">

		<div class="page__bd">
			<!--<a href="javascript:;" class="weui-btn weui-btn_primary">点击展现searchBar</a>-->

			<div class="weui-search-bar" id="searchBar">

				<form class="weui-search-bar__form"
					action="<%=basePath%>api/wechat/incident/search">
					<div class="weui-search-bar__box">
						<i class="weui-icon-search"></i> <input type="search"
							class="weui-search-bar__input" id="searchInput" placeholder="搜索"
							required="" name="keyword" value="${keyword }"> <a
							href="javascript:" class="weui-icon-clear" id="searchClear"></a>
					</div>
					<label class="weui-search-bar__label" id="searchText"> <i
						class="weui-icon-search"></i> <span>搜索</span> </label>
						
				</form>
				<a href="javascript:" class="weui-search-bar__cancel-btn"
					id="searchCancel">取消</a>
			</div>
			
			<div class="weui-cells searchbar-result" id="searchResult"
				style="display:none;">
			</div>
		</div>
	</div>


</div>

<script type="text/javascript">
	$(function() {
		var $searchBar = $('#searchBar'), $searchResult = $('#searchResult'), $searchText = $('#searchText'), $searchInput = $('#searchInput'), $searchClear = $('#searchClear'), $searchCancel = $('#searchCancel');

		function hideSearchResult() {
			$searchResult.hide();
			$searchInput.val('');
		}
		function cancelSearch() {
			hideSearchResult();
			$searchBar.removeClass('weui-search-bar_focusing');
			$searchText.show();
		}

		$searchText.on('click', function() {
			$searchBar.addClass('weui-search-bar_focusing');
			$searchInput.focus();
		});
		$searchInput.on('blur', function() {
			if (!this.value.length)
				cancelSearch();
		}).on('input', function() {
			if (this.value.length) {
				$searchResult.show();
			} else {
				$searchResult.hide();
			}
		});
		$searchClear.on('click', function() {
			hideSearchResult();
			$searchInput.focus();
		});
		$searchCancel.on('click', function() {
			cancelSearch();
			$searchInput.blur();
		});
	});
</script>
<div data-role="listview" style="">
	<c:forEach var="entity" items="${result.content }">
	<a class="weui-cell weui-cell_access"
			href="<%=basePath%>api/wechat/incident/incidentInfo?id=${entity.id }">
			<div class="weui-cell__bd">
				<h4 class="weui-media-box__title" style='font-size:17px;'>[${entity.code}]${entity.title}
				</h4>
				<p class="weui-media-box__desc">事件状态：<span style="color:red">${entity.status }</span></p>
				<p class="weui-media-box__desc">项目名称：${entity.project_name }</p>
				<p class="weui-media-box__desc">创建时间：<fmt:formatDate value="${entity.create_date }"
					pattern="yyyy-MM-dd HH:mm" /></p>
				<p class="weui-media-box__desc">事件类型：${entity.incident_type }</p>
				
				
			</div>
		 </a>

	</c:forEach>
</div>
${pager}
